# TODO
from timer import Timer
from protocol import *
import time

class CorrectorTimer(Timer):
	def __init__(self, interval, dispatcher):
		Timer.__init__(self, interval)
		self.dispatcher = dispatcher

	def onTimeout(self, time):
		units = self.dispatcher.getUnits()
		now = time.time()

		for unit in units:
			units.write()
			units._correctionStart = now

